#include <stdio.h>
#include <stdbool.h>

int main(){
	bool digitSeen[10] = {false};

	printf("Enter a digit:");
	long n;
	int digit;
	int repdigit[10] = {-1};
	int repIndex = 0;
	bool hasRep = false;

	scanf("%ld", &n);
	while (n>0) {
		digit = n % 10;
		if (digitSeen[digit]){
			repdigit[repIndex] = digit;
			repIndex += 1;
			hasRep = true;
		}
		else
			digitSeen[digit] = true;
		n = n/10;
	}
	if (hasRep){
		printf("Repeated digit: ");
		for (int i = 0; i < repIndex; ++i){
			printf("%d ", repdigit[i]);
		}
		printf("\n");
	} else
		printf("No Repeated digit!\n");
}
